'use strict';

const Controller = require('egg').Controller;

class NewsController extends Controller {
  async getNewsByPage(ctx) {

    const page = ctx.params.page;

    const result = await ctx.service.news.getTopStories(page);

    ctx.body = {
      success: true,
      result: result,
    };
  }
}

module.exports = NewsController;
